class CustomModel {
  String payAmt;
  String payable;
  String needAmt;
  bool fullScreen;
  List<Ad> ads;
  List<Product> products;

  CustomModel({
    required this.payAmt,
    required this.payable,
    required this.needAmt,
    required this.fullScreen,
    required this.ads,
    required this.products,
  });

  Map<String, dynamic> toJson() => {
        "payAmt": payAmt,
        "payable": payable,
        "needAmt": needAmt,
        "fullScreen": fullScreen,
        "ads": ads.map((e) => e.toJson()).toList(),
        "products": products.map((e) => e.toJson()).toList()
      };
}

class Product {
  String name;
  String price;
  int count;

  Product(this.name, this.price, this.count);

  Map<String, dynamic> toJson() => {
        "name": name,
        "price": price,
        "count": count,
      };
}

class Ad {
  static const int TYPE_IMAGE = 0;
  static const int TYPE_VIDEO = 1;

  int type;
  String url;

  Ad({required this.type, required this.url});

  Map<String, dynamic> toJson() => {
        "type": type,
        "url": url,
      };
}
